<template>
  <el-container>
    <el-header style="height: 30px">
      <el-page-header @back="goBack">
        <template slot="title">
          返回列表
        </template>
      </el-page-header>
    </el-header>
    <el-main>
      <div style="border:1px solid darkgrey;height: calc( 100% - 2px )">
        <div style="text-align: center;border-bottom:1px solid darkgrey; width: calc( 100% - 50px ); margin:0 auto;">
          <h3>{{ messageItem.title }}</h3>
          <h5 style="font-size: 12px;">{{ messageItem.receiveTime }}</h5>
        </div>
        <div style="width: calc( 100% - 50px ); margin:0 auto;" v-html="messageItem.body"></div>
      </div>
    </el-main>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      messageItem:{
      }
    }
  },
  mounted() {
    let id = this.$route.params.id;
    this.$service.data.objectQuery({routeData:{name:'UserMessageItem'}, params: {messageId:id}}).then(r => {
      this.messageItem = r.data;
    });
  },
  methods: {
    goBack(){
      this.$router.push({name:'userMessageList'})
    }
  }
}
</script>